import { defineStore } from "pinia";

export const useCounterStore = defineStore("counter", {
  persist: true,
  state() {
    return {
      token: "",
      // 注册用户名
      username: "",
    };
  },
  actions: {
    setToken(token: string) {
      this.token = token;
    },
    setUsername(username: string) {
      this.username = username;
    },
    delToken() {
      this.token = "";
    },
  },
});
